package org.jerrymouse.agentContainer;

import org.jerrymouse.jsa4j.db.kv.DBManagerFactory;
import org.jerrymouse.jsa4j.db.kv.DBManagerFactory.DBManagerType;

public class AgentContainerFactory {
	private static AgentContainer agentContainer;

	private DBManagerType dbManagerType = DBManagerType.DERBY;

	public void setDbManagerType(DBManagerType dbManagerType) {
		this.dbManagerType = dbManagerType;
	}

	public AgentContainer get() {
		if (agentContainer == null) {
			agentContainer = new AgentContainer();
			agentContainer.db = new DBManagerFactory().getDBManager(
					dbManagerType).getDB();
		}
		return agentContainer;
	}
}
